#include "udpClient.hpp"
#include <memory>//智能指针头文件
using namespace std;
using namespace Client;
static void Usage(string proc)//使用手册
{
    cout<<"\nUsag:\n\t"<<proc<<"server_ip server_port\n\n";
}
int main(int argc ,char* argv[])//./udpClient server_ip server_port
{
    if(argc!=3)
    {
        Usage(argv[0]);
        exit(Usage_ERR);
    }
    uint16_t serverport = atoi(argv[2]);//argv是一个指针数组，里面存的是指针，指向字符串
    string serverip = argv[1];
    std::unique_ptr<udpClient> ucli(new udpClient(serverip,serverport));
    ucli->initClient();
    ucli->run();
    return 0;
}
